import { useState } from "react";
import { useNavigate } from "react-router-dom";
function Fenlei() {
  let [id] = useState(0);
  let [name, setName] = useState("张三");
  let navigate = useNavigate()
  function gotoGouwuche(obj) {
    console.log(obj);
    // history.push("/gouwuche")
    navigate("/gouwuche")
  }


  return (
    <div>
      分类
      <div>{id}</div>
      <div>{name}</div>
      <div onClick={gotoGouwuche}>跳转到购物车</div>
    </div>
  );
}

export default Fenlei;